<?php

// uncomment the following to define a path alias
// Yii::setPathOfAlias('local','path/to/local-folder');
// This is the main Web application configuration. Any writable
// CWebApplication properties can be configured here.
return array(
    'basePath' => dirname(__FILE__) . DIRECTORY_SEPARATOR . '..',
    'name' => 'e-Office',
    'theme' => 'blues',
    // preloading 'log' component
    'preload' => array('log'),
    // autoloading model and component classes
    'import' => array(
        'application.models.*',
        'application.components.*',
        'application.modules.rights.*',
        'application.modules.rights.components.*',
        'application.extensions.yiidebugtb.*', // Debug Toolbar
    ),
    'modules' => array(
        // uncomment the following to enable the Gii tool
        'gii' => array(
            'class' => 'system.gii.GiiModule',
            'generatorPaths' => array(
                'application.gii',
            ),
            'password' => '1',
            // If removed, Gii defaults to localhost only. Edit carefully to taste.
            'ipFilters' => array('127.0.0.1', '::1'),
        ),
        'rights' => array(
            'superuserName'=>'Admin',
            'userClass' => 'Pegawai',
            'authenticatedName'=>'Authenticated',
            'userIdColumn'=>'id_pegawai',
            'userNameColumn'=>'nip',
            'enableBizRule'=>true,
            'enableBizRuleData'=>false,
            'displayDescription'=>true,
            'flashSuccessKey'=>'RightsSuccess',
            'flashErrorKey'=>'RightsError',
            'baseUrl'=>'/rights',
            'layout'=>'rights.views.layouts.main',
            'appLayout'=>'application.views.layouts.main',
            'cssFile'=>'rights.css',
            'install'=>true,
            'debug'=>false,
        ),
    ),
    // application components
    'components' => array(
        'user' => array(
            'class' => 'WebUser',
            // enable cookie-based authentication
            'loginUrl' => array('/site/login'),
            'logoutUrl' => array('/site/logout'),
            'signupUrl' => array('/site/signup'),
            'allowAutoLogin' => false,
        ),
        'authManager' => array(
            'class' => 'RDbAuthManager', // Provides support authorization item sorting. ...... 
        ),
        'file'=>array(
            'class'=>'application.extensions.file.CFile',
        ),
        // uncomment the following to enable URLs in path-format

        'urlManager' => array(
            'showScriptName' => false,
            'urlFormat' => 'path',
            'rules' => array(
                '/login' => '/site/login',
                '/logout' => '/site/logout',
                '/mReferencess/index/<view>/<parameter>'=>'/mReferencess/index/',
                '/mReferencess/create/<view>/<parameter>'=>'/mReferencess/create/',
                '/mReferencess/update/<view>/<parameter>/id/<id:\d+>'=>'/mReferencess/update/',
                '/mReferencess/view/<view>/id/<id:\d+>'=>'/mReferencess/view/',
                '<controller:\w+>/<id:\d+>' => '<controller>/view',
                '<controller:\w+>/<action:\w+>/<id:\d+>' => '<controller>/<action>',
                '<controller:\w+>/<action:\w+>' => '<controller>/<action>',
                
            ),
        ),
        'format' => array(
            'datetimeFormat' => 'd-M-Y H:i:s A',
            'dateFormat' => 'd-M-Y',
            'timeFormat' => 'H:i:s A',
        ),
        /* 'db'=>array(
          'connectionString' => 'sqlite:'.dirname(__FILE__).'/../data/testdrive.db',
          ), */
        // uncomment the following to use a MySQL database

        'db' => array(
            'connectionString' => 'mysql:host=localhost;dbname=paperless',
            'emulatePrepare' => true,
            'username' => 'root',
            'password' => '12056309',
            'charset' => 'utf8',
            'enableParamLogging'=>true, 
        ),
        'errorHandler' => array(
            // use 'site/error' action to display errors
            'errorAction' => 'site/error',
        ),
        'log' => array(
            'class' => 'CLogRouter',
            'routes' => array(
             // debug toolbar configuration 
            array( // configuration for the toolbar
                'class'=>'XWebDebugRouter',
                'config'=>'alignLeft, opaque, runInDebug, fixedPos, collapsed, yamlStyle',
                'levels'=>'error, warning, trace, profile, info',
                'allowedIPs'=>array('127.0.0.1','::1','192.168.1.54','192\.168\.1[0-5]\.[0-9]{3}'),
            ),
            // uncomment the following to show log messages on web pages
            
             /* array(
              'class'=>'CWebLogRoute',
              ),
             */
            ),
        ),
        'ePdf' => array(
            'class'         => 'ext.yii-pdf.EYiiPdf',
            'params'        => array(
                'mpdf'     => array(
                    'librarySourcePath' => 'application.vendors.mpdf.*',
                    'constants'         => array(
                        '_MPDF_TEMP_PATH' => Yii::getPathOfAlias('application.runtime'),
                    ),
                    'class'=>'mpdf', // the literal class filename to be loaded from the vendors folder
                    /*'defaultParams'     => array( // More info: http://mpdf1.com/manual/index.php?tid=184
                        'mode'              => '', //  This parameter specifies the mode of the new document.
                        'format'            => 'A4', // format A4, A5, ...
                        'default_font_size' => 0, // Sets the default document font size in points (pt)
                        'default_font'      => '', // Sets the default font-family for the new document.
                        'mgl'               => 15, // margin_left. Sets the page margins for the new document.
                        'mgr'               => 15, // margin_right
                        'mgt'               => 16, // margin_top
                        'mgb'               => 16, // margin_bottom
                        'mgh'               => 9, // margin_header
                        'mgf'               => 9, // margin_footer
                        'orientation'       => 'P', // landscape or portrait orientation
                    )*/
                ),
                'HTML2PDF' => array(
                    'librarySourcePath' => 'application.vendors.html2pdf.*',
                    'classFile'         => 'html2pdf.class.php', // For adding to Yii::$classMap
                    'defaultParams'     => array( // More info: http://wiki.spipu.net/doku.php?id=html2pdf:en:v4:accueil
                        'orientation' => 'P', // landscape or portrait orientation
                        'format'      => 'A4', // format A4, A5, ...
                        'language'    => 'en', // language: fr, en, it ...
                        'unicode'     => true, // TRUE means clustering the input text IS unicode (default = true)
                        'encoding'    => 'UTF-8', // charset encoding; Default is UTF-8
                        'marges'      => array(30, 5, 5, 8), // margins by default, in order (left, top, right, bottom)
                    )
                )
            ),
        ),
    ),
    // application-level parameters that can be accessed
    // using Yii::app()->params['paramName']
    'params' => array(
        // this is used in contact page
        'adminEmail' => 'webmaster@example.com',
        'appDescription' => '',
        
        'SuratMasukPath' => '/home/aris/data/data_ais/server_data/e-office/files/surat_masuk/' 
    ),
);
